spring:
  config:
    import: optional:file:.env[.properties]

  datasource:
    driverClassName: org.postgresql.Driver
    username: ${POSTGRES_USERNAME}
    password: ${POSTGRES_PASSWORD}
    url: jdbc:postgresql://${POSTGRES_HOST}:5432/${POSTGRES_DATABASE}?currentSchema=${POSTGRES_SCHEMA}

  jpa:
    hibernate:
      ddl-auto: none
    database-platform: org.hibernate.dialect.PostgreSQLDialect
    properties:
      format_sql: true
      show_sql: false

  flyway:
    default-schema: ${POSTGRES_SCHEMA}
    init-sqls: create schema if not exists ${POSTGRES_SCHEMA};

  cache:
    type: redis
    cache-names: redis-cache

  data:
    redis:
      host: ${REDIS_HOST}
      password: ${REDIS_PASSWORD}
      port: 6379
      ttl: 10m

  mail:
    host: ${MAIL_HOST}
    port: ${MAIL_PORT}
    username: ${MAIL_USERNAME}
    password: ${MAIL_PASSWORD}
    properties:
      mail:
        debug: false
        transport:
          protocol: smtp
        smtp:
          auth: true
          starttls:
            enable: true
    timeByExpiration: 1h

security:
  jwt:
    secretKey: ${JWT_SECRET}
    tokenExpiration: 5m
    refreshTokenExpiration: 30m

  cors:
    allowedOrigins: "*"
    allowedMethods: "*"
    allowedHeaders: "*"
    exposedHeaders: "*"

springdoc:
  override-with-generic-response: false
  show-actuator: true

management:
  endpoints:
    web:
      exposure:
        include: self, health
